<template>
    <div>
        <heard :title="title"></heard>
        <van-address-list v-model="chosenAddressId" :list="list" :disabled-list="disabledList" default-tag-text="默认"
            @add="onAdd" @edit="onEdit" add-button-text="去支付" />
        <van-cell-group inset>
            <van-cell title="订单号" :value="getOrder.orderId" />
            <van-cell title="下单时间" :value="getOrder.create_time" />
            <van-cell title="商品描述" :value="getOrder.product_code" />
            <van-cell title="商品价格" :value="getOrder.totalPrice/100" />
           
        </van-cell-group>







    </div>
</template>

<script setup>
import heard from '@/components/heard.vue';
const title = "订单页"
import { ref } from 'vue';
import { useRoute } from 'vue-router';
const route = useRoute()
import { getOrderApi } from '@/api/api';
let getOrder = ref([])
getOrderApi(route.params.orderId).then(res => {
    console.log('订单页', res)
    getOrder.value = res.data.data
    pay.value={
        orderId:getOrder.value.orderId,
        subject:getOrder.value.product_code,
        totalPrice:getOrder.value.totalPrice/100

    }

})
 const list = [
      {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
      },
    
    ];
import { payApi } from '@/api/api';
let pay=ref([])
const onAdd=()=>{
    payApi().then(res=>{
        console.log('支付接口',res)
        pay.value=res.data.data
        window.open(res.data.data,'_blank')
    })
}


</script>

<style lang="scss" scoped></style>